package xyz.hzxiao.order.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.hzxiao.entity.order.DemoOrderEntity;
import xyz.hzxiao.order.service.DemoOrderService;
import xyz.hzxiao.result.JsonResult;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author FuXx
 * @since 2023-12-05
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/order")
public class DemoOrderController {

    private final DemoOrderService currentService;

    @GetMapping("/queryOrderByUserId")
    public JsonResult<List<DemoOrderEntity>> orderList(Integer userId) throws InterruptedException {
        return currentService.orderList(userId);
    }
}
